package model.domain;


import javax.persistence.Column;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name = "projectparticipation", catalog = "scrum")
public class ProjectParticipation implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer PPID;
	private Person person;
	private Project project;

	public ProjectParticipation() {
	}

	public ProjectParticipation(Integer id, Person person,
			Project project) {
		this.PPID = id;
		this.person = person;
		this.project = project;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "nPPID", unique = true, nullable = false)
	public Integer getPPID() {
		return this.PPID;
	}

	public void setPPID(Integer id) {
		this.PPID = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "nUserID", nullable = false, insertable = false, updatable = false)
	public Person getPerson() {
		return this.person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "nProjectID", nullable = false, insertable = false, updatable = false)
	public Project getProject() {
		return this.project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

}
